@import './variables.scss';

// 全局样式重置
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: $font-size-base;
  color: $text-color;
  background-color: $background-color;
  line-height: 1.6;
}

#root {
  height: 100%;
  overflow: hidden;
}

// 通用工具类
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-center {
  @include flex-center;
}

.flex-between {
  @include flex-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.mb-sm {
  margin-bottom: $spacing-sm;
}

.mb-md {
  margin-bottom: $spacing-md;
}

.mb-lg {
  margin-bottom: $spacing-lg;
}

.mt-sm {
  margin-top: $spacing-sm;
}

.mt-md {
  margin-top: $spacing-md;
}

.mt-lg {
  margin-top: $spacing-lg;
}

.p-sm {
  padding: $spacing-sm;
}

.p-md {
  padding: $spacing-md;
}

.p-lg {
  padding: $spacing-lg;
}

// 卡片样式
.card {
  @include card-style;
}

.card-hover {
  @include card-style;
  @include hover-effect;
}

// 文本省略
.text-ellipsis {
  @include text-ellipsis;
}

// 加载状态
.loading-container {
  @include flex-center;
  height: 200px;
  color: $text-color-secondary;
}

// 空状态
.empty-container {
  @include flex-center;
  flex-direction: column;
  height: 200px;
  color: $text-color-secondary;
  
  .empty-icon {
    font-size: 48px;
    margin-bottom: $spacing-md;
    opacity: 0.5;
  }
  
  .empty-text {
    font-size: $font-size-lg;
  }
}

// 分页器容器样式
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  padding: 16px 0;
}

// 全局分页器样式 - 直接覆盖 Ant Design 默认样式
.ant-pagination {
  // 页码项
  .ant-pagination-item {
    min-width: 28px !important;
    height: 28px !important;
    line-height: 26px !important;
    font-size: 13px !important;
    margin: 0 3px !important;
    
    a {
      font-size: 13px !important;
      line-height: 26px !important;
    }
  }
  
  // 当前选中页码 - 优化颜色对比度
  .ant-pagination-item-active {
    font-weight: 600 !important;
    background-color: #1890ff !important;
    border-color: #1890ff !important;
    
    a {
      color: #fff !important;
    }
  }
  
  // 上一页/下一页按钮
  .ant-pagination-prev,
  .ant-pagination-next {
    min-width: 28px !important;
    height: 28px !important;
    line-height: 26px !important;
    margin: 0 3px !important;
    
    button {
      height: 100% !important;
      line-height: 26px !important;
    }
    
    .ant-pagination-item-link {
      font-size: 13px !important;
      line-height: 26px !important;
    }
  }
  
  // 快速跳转按钮
  .ant-pagination-jump-prev,
  .ant-pagination-jump-next {
    min-width: 28px !important;
    height: 28px !important;
    line-height: 26px !important;
    margin: 0 3px !important;
    
    .ant-pagination-item-container {
      line-height: 26px !important;
      
      .ant-pagination-item-ellipsis {
        font-size: 13px !important;
      }
      
      .ant-pagination-item-link-icon {
        font-size: 11px !important;
      }
    }
  }
  
  // 页码选择器
  .ant-pagination-options {
    margin-left: 12px !important;
    
    .ant-pagination-options-size-changer {
      .ant-select-selector {
        height: 28px !important;
        padding: 0 8px !important;
        font-size: 13px !important;
        
        .ant-select-selection-item {
          line-height: 26px !important;
          font-size: 13px !important;
        }
      }
    }
    
    .ant-pagination-options-quick-jumper {
      height: 28px !important;
      line-height: 28px !important;
      font-size: 13px !important;
      
      input {
        height: 28px !important;
        width: 45px !important;
        font-size: 13px !important;
        padding: 3px 7px !important;
        margin: 0 6px !important;
      }
    }
  }
  
  // 总数显示
  .ant-pagination-total-text {
    height: 28px !important;
    line-height: 28px !important;
    font-size: 13px !important;
    margin-right: 8px !important;
  }
}